<script>
import axios from "axios";

export default {
  name: "excellentCourses",
  data(){
    return{
      courseBoutiqueList:[],
    }
  },
  methods:{

  },
  created() {
    axios.post('/api/weChat/applet/course/list/type',{
      type:'boutique',
      pageNum:1,
      pageSize:5,
    },{
      headers:{'content-type':'application/x-www-form-urlencoded'}
    }).then(res=>{
      console.log(res)
      if(res.data.code===0){
        this.courseBoutiqueList=res.data.rows;
      }
    })
  }
}
</script>

<template>
<div>
  <div class="w">
    <div class="mianfei">
      <div class="mf-title">
        <div>
          <img src="../assets/精品.png" alt=""/>
          <p>精品课程</p>
          <img class="vipFree" src="../assets/vip免费.png" alt=""/>
        </div>
        <a href="#">更多</a>
      </div>
      <div class="mf-conter">
        <div class="mf-ce-mb" v-for="item in courseBoutiqueList" :key="item.courseId">
          <router-link to="/xiangqin">
          <div class="mf-ce-mb-img">
            <img :src="item.coverFileUrl" alt=""/></div>
          <P>{{item.courseTitle}}</P>
          <p>共{{item.learningNum}}节课|共{{item.learningNum}}人报名</p>
          <div class="money1" v-if="item.isFree==='1'">免费</div>
          <div class="money" v-else-if="item.isDiscount==='1'">
            {{item.discountPrice}}
            <del>{{item.coursePrice}}</del>
          </div>
          <div class="money" v-else>
            {{item.coursePrice}}
          </div>
          </router-link>
        </div>

      </div>

    </div>
  </div>
</div>
</template>

<style scoped lang="less">
* {
  margin: 0;
  padding: 0;
}
a{
  text-decoration: none;
}
li{
  list-style: none;
}
.w {
  width: 1200px;
  margin: 0 auto;

}
.mianfei {
  border: 1px solid white;
  background-color: white;
  border-radius: 10px;
  margin: 10px 0;
}

.mf-title {
  display: flex;
  justify-content: space-between;
  align-items:end;
  border-bottom: 1px solid black;
  padding: 10px 5px;
  padding-bottom:0;

}
.mf-title div {
  display: flex;
  align-items:end;
}
.mf-title div p {
  font-size: 25px;
}
.mf-title div img:first-child {
  width: 40px;
  height: 40px;
}
.mf-title a {
  font-size: 19px;
}
.mf-conter, .mf-conter1, .mf-conter2, .mf-conter3 {
  height: 240px;
  display: flex;
  justify-content: space-around;
  margin-top: 10px;
}
.mf-ce-mb {
  width: 200px;
  height: 210px;
  border-radius: 10px;
  box-shadow: 0px 0px 10px grey;
  overflow: hidden;
}

.free {
  color: green;
}
.mf-ce-mb-img {
  width: 200px;
  height: 120px;
  overflow: hidden;
}
.mf-ce-mb-img:hover img{
  transform: scale(1.2, 1.2);
}
.mf-ce-mb-img img {
  width: 100%;
  height: 100%;
  transition: transform 0.5s linear;

}
.mf-ce-mb p {
  margin: 5px;
}
.mf-ce-mb P:nth-child(3){
  color: grey;
}
.money1 {
  font-size: 15px;
  color: green;
  margin: 5px;
}
.vipFree {
  width: 100px;
  height: 35px;
}
.money {
  font-size: 15px;
  color: red;
  margin: 5px;
}
</style>